<?php
include "../librari/koneksi.php";

  $id=$_POST['id'];
  $nama=$_POST['nama'];
  $passwd=$_POST['passwd'];

 if($id!="" && $nama!="" && $passwd!=""){
 $sql = "INSERT INTO administrator set idAdmin='".$_POST['id']."', nmAdmin='".$_POST['nama']."',
									passwdAdmin='".$_POST['passwd']."'"
									;
									
mysql_query($sql)
or die ("Gagal query simpan: ".mysql_error());
}

 if($id =="" || $nama =="" || $passwd==""){
 echo "<script language='JavaScript'>document.location='admin.php';
alert('Ada data yang belum diisi. Silahkan Ulangi Kembali.   --".$id."--".$nama."--".$passwd."  Klik OK!');
 </script>"; }
 
 echo "<script language='JavaScript'>document.location='admin.php';
alert('Sukses. Klik OK!'); </script>";
	
?>